﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Castle.ActiveRecord;
using ZDSoft.QLMS.Entity.SystemSetting;
using ZDSoft.QLMS.Entity.Rules;
using ZDSoft.QLMS.Entity.QuestionLibrary;
using ZDSoft.QLMS.Entity.TestOnline;

namespace ZDSoft.QLMS.Entity
{
    [ActiveRecord]
    public class Course : EntityBase<Course>
    {
        //课程名称
        [Property]
        public string Name { get; set; }

        //状态
        [Property]
        public bool IsActive { get; set; }

        [BelongsTo("OrganizationID")]
        public Organization Organization { get; set; }

        //该课程拥有的知识点
        [HasMany(typeof(KnowledgePoint), ColumnKey = "CourseID", Inverse = true)]
        public IList<KnowledgePoint> KnowledgePoints { get; set; }

        [HasMany(typeof(UserCourse), ColumnKey = "CourseID", Inverse = true)]
        public IList<UserCourse> UserCourses { get; set; }

        //该课程拥有的题目
        [HasMany(typeof(Question), ColumnKey = "CourseID", Inverse = true)]
        public IList<Question> Questions { get; set; }

        [HasMany(typeof(TestPaperRule), ColumnKey = "CourseID", Inverse = true)]
        public IList<TestPaperRule> TestPaperRules{get;set;}

        [HasMany(typeof(TestPaper), ColumnKey = "CourseID", Inverse = true)]
        public IList<TestPaper> TestPapers { get; set; }

        [HasMany(typeof(Test), ColumnKey = "CourseID", Inverse = true)]
        public IList<Test> Tests { get; set; }
    }
}
